package wild.horse.iwardrobe.activity;

import wild.horse.activity.R;
import wild.horse.iwardrobe.Constants;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;

public class BriefingActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_briefing);
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
			
			@Override
			public void run() {
				SharedPreferences pref = getSharedPreferences(Constants.PREF_NAME, Activity.MODE_PRIVATE);
				SharedPreferences.Editor editor = pref.edit();
				Intent intent = new Intent();
				if(pref.getBoolean(Constants.PREF_NEED_GUIDE, true)){
					intent.setClass(BriefingActivity.this, FirstGuideActivity.class);
					editor.putBoolean(Constants.PREF_NEED_GUIDE, false);
					editor.commit();
				}else {
					intent.setClass(BriefingActivity.this, MainActivity.class);
				}
				startActivity(intent);
				BriefingActivity.this.finish();
			}
		}, 2000);
    }
}